package hexapawn.game;

/**
 * class Piece - The object that represents an individual Piece (Pawn).
 * The variables r and c represent the location of the current piece.
 * This location starts at (0, 0) the top left and goes to 
 * (board.row - 1, board.column -1) the bottom right of the board.
 * 
 * @author ChaoSXDemon
 *
 */
public class Piece {
	
	private int r, c, owner;
	
	/**
	 * Constructor - Creates a Piece object at row = _r, column = _c and owner
	 * 				 = either Player.PLAYER_1, Player.PLAYER_2, Player.MDPPLAYER,
	 * 				 or Player.MINIMAXPLAYER.
	 * 
	 * @param _r - The row
	 * @param _c - The Column
	 * @param _owner - The player type; one of: Player.PLAYER_1, Player.PLAYER_2, 
	 *  			   Player.MDPPLAYER, or Player.MINIMAXPLAYER.
	 */
	public Piece(int _r, int _c, int _owner){
		r = _r;
		c = _c;
		owner = _owner;
	}
	
	/**
	 * Moves the piece to row = _r and column = _c location. This method does
	 * not check for boundary.
	 * 
	 * @param _r - the row to move to
	 * @param _c - the column to move to
	 */
	public void moveTo(int _r, int _c){
		r = _r;
		c = _c;
	}
	
	/**
	 * Returns the row location of this Piece
	 * 
	 * @return - The row
	 */
	public int getRow(){
		return r;
	}
	
	/**
	 * Returns the column location of this Piece
	 * 
	 * @return - The column
	 */
	public int getColumn(){
		return c;
	}
	
	/**
	 * Returns the owner of this piece. It can be: Player.PLAYER_1, 
	 * Player.PLAYER_2, Player.MDPPLAYER, or Player.MINIMAXPLAYER.
	 * 
	 * @return - Player.PLAYER_1, Player.PLAYER_2, Player.MDPPLAYER, 
	 * 			 or Player.MINIMAXPLAYER.
	 */
	public int getOwner(){
		return owner;
	}
	
}
